package com.yn.xr.user.mode;

import static javax.persistence.GenerationType.IDENTITY;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.yn.xr.common.constants.UserDef;
import com.yn.xr.common.constants.UserDef.UserLockStatus;
import com.yn.xr.common.entity.BaseEntity;

/**
 * 
 * @description:用户数据实体对象
 * @fileName:TUserRegister.java
 * @createTime:2015年1月24日 下午10:04:04
 * @author:陈权福
 * @version 1.0.0
 * 
 */
@Entity
@Table(name = "t_user_register", catalog = "xrnetwork")
public class UserRegister extends BaseEntity
{
	
	private static final long serialVersionUID = -2629144176818108684L;
	
	// 本地唯一标识
	protected Long userId;
	
	// 账号系统唯一标识
	protected Long uid;
	
	// 惠信号(用户名)
	protected String accName;
	
	// 登录密码
	protected String pwd;
	
	// 支付密码
	protected String payPwd;
	
	// 邮箱地址
	protected String email;
	
	// 修改邮箱地址
	protected String updateEmail;
	
	// 邮箱状态 (1=无,2=激活,3=未激活）
	protected Short emailStatus;
	
	// 手机号
	protected String mobile;
	
	// 真实姓名
	protected String realName;
	
	// 身份证号
	protected String idcard;
	
	// 性别(1=男,2=女,0=未设)
	protected Short gender;
	
	// 用户角色
	protected Short userType;
	
	// 用户级别
	protected Short vipGrade;
	
	
	// 移动端支付开关 1-开 2-关
	protected Short mobilePaySwitchStatus;
	
	// 用户状态(1激活,2锁定)
	protected Short status;
	
	// 账户安全级别(0 表示等级高，1和2表示中等级，3和4表示低等级)
	protected Short safelevel;
	
	// 支付密码输入错误次数
	protected Short payPwdFailCount;
	
	// 支付功能锁定时间
	protected Date lockPayTime;
	
	// 上次登录时间
	protected Date loginedTime;
	
	// 本次登录时间
	protected Date logiTempTime;
	
	// 登录失败次数
	protected Short loginFailCount;
	
	// 登录锁定时间
	protected Date lockLoginTime;
	
	// 注册时间
	protected Date registerTime;
	
	// 注册渠道(1:pc,2:移动)
	protected Short terminalsType;
	
	// 服务端跟新时间戳
	protected Integer upateStamp;
	
	// 账户系统平台标识
	protected Integer accSysMerId;
	
	// 推广代码
	protected Integer investCode;
	
	// 余额
	protected BigDecimal cash;
	
	// 提现冻结金额
	protected BigDecimal congealWithdrawCash;
	
	// 定投冻结金额
	protected BigDecimal hkbInvestAmount;
	
	// 收益总金额
	protected BigDecimal profitAmount;
	
	// 提现总金额
	protected BigDecimal withdrawAccumulate;
	
	// 提现费用总金额
	protected BigDecimal withdrawFeeAccumulate;
	
	// 充值总金额
	protected BigDecimal rechargeAccumulate;
	
	// 银行卡号
	protected String bankCardID;
	
	// 银行开户行
	protected String dataName;
	
	// 银行代码
	private Integer bankCode;
	
	// 推广人真实姓名
	protected String investRealName;
	
	// 单日已支付金额
	private BigDecimal singleDaypayedAmount;
	
	//惠信号修改次数
	private Integer acc_cnt;
	
	//体验金发放标示数据
	private Integer tasteSign;
	
	private int[] vip;
	//用户体验金账号余额
	private BigDecimal tasteAccAmount;
	
	
	
	// Constructors
	
	/** default constructor */
	public UserRegister()
	{
	}
	
	/** minimal constructor */
	public UserRegister(Long userId)
	{
		this.userId = userId;
	}
	
	/** full constructor */
	public UserRegister(Long userId, Long uid, String accName, String pwd,
			String payPwd, String email, String updateEmail, Short emailStatus,
			String mobile, String realName, String idcard, Short gender,
			Short userType, Short vipGrade, Short mobilePaySwitchStatus,
			Short status, Short safelevel, Short payPwdFailCount,
			Date lockPayTime, Date loginedTime, Date logiTempTime,
			Short loginFailCount, Date lockLoginTime, Date registerTime,
			Short terminalsType, Integer upateStamp, Integer accSysMerId,Integer investCode,
			Integer tasteSign)
	{
		this.userId = userId;
		this.uid = uid;
		this.accName = accName;
		this.pwd = pwd;
		this.payPwd = payPwd;
		this.email = email;
		this.updateEmail = updateEmail;
		this.emailStatus = emailStatus;
		this.mobile = mobile;
		this.realName = realName;
		this.idcard = idcard;
		this.gender = gender;
		this.userType = userType;
		this.vipGrade = vipGrade;
		this.mobilePaySwitchStatus = mobilePaySwitchStatus;
		this.status = status;
		this.safelevel = safelevel;
		this.payPwdFailCount = payPwdFailCount;
		this.lockPayTime = lockPayTime;
		this.loginedTime = loginedTime;
		this.logiTempTime = logiTempTime;
		this.loginFailCount = loginFailCount;
		this.lockLoginTime = lockLoginTime;
		this.registerTime = registerTime;
		this.terminalsType = terminalsType;
		this.upateStamp = upateStamp;
		this.accSysMerId = accSysMerId;
		this.investCode = investCode;
		this.tasteSign = tasteSign;
	}
	
	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "userId", unique = true, nullable = false)
	public Long getUserId()
	{
		return this.userId;
	}
	
	public void setUserId(Long userId)
	{
		this.userId = userId;
	}
	
	
	@Column(name = "uId")
	public Long getUid()
	{
		return this.uid;
	}
	
	public void setUid(Long uid)
	{
		this.uid = uid;
	}
	
	@Column(name = "accName", length = 20)
	public String getAccName()
	{
		return this.accName;
	}
	
	public void setAccName(String accName)
	{
		this.accName = accName;
	}
	
	@Column(name = "pwd", length = 32)
	public String getPwd()
	{
		return this.pwd;
	}
	
	public void setPwd(String pwd)
	{
		this.pwd = pwd;
	}
	
	@Column(name = "payPwd", length = 32)
	public String getPayPwd()
	{
		return this.payPwd;
	}
	
	public void setPayPwd(String payPwd)
	{
		this.payPwd = payPwd;
	}
	
	@Column(name = "email", length = 30)
	public String getEmail()
	{
		return this.email;
	}
	
	public void setEmail(String email)
	{
		this.email = email;
	}
	
	@Column(name = "updateEmail", length = 30)
	public String getUpdateEmail()
	{
		return this.updateEmail;
	}
	
	public void setUpdateEmail(String updateEmail)
	{
		this.updateEmail = updateEmail;
	}
	
	@Column(name = "emailStatus")
	public Short getEmailStatus()
	{
		return this.emailStatus;
	}
	
	public void setEmailStatus(Short emailStatus)
	{
		this.emailStatus = emailStatus;
	}
	
	@Column(name = "mobile", length = 13)
	public String getMobile()
	{
		return this.mobile;
	}
	
	public void setMobile(String mobile)
	{
		this.mobile = mobile;
	}
	
	@Column(name = "realName", length = 10)
	public String getRealName()
	{
		return this.realName;
	}
	
	public void setRealName(String realName)
	{
		this.realName = realName;
	}
	
	@Column(name = "IDCard", length = 18)
	public String getIdcard()
	{
		return this.idcard;
	}
	
	public void setIdcard(String idcard)
	{
		this.idcard = idcard;
	}
	
	@Column(name = "gender")
	public Short getGender()
	{
		return this.gender;
	}
	
	public void setGender(Short gender)
	{
		this.gender = gender;
	}
	
	@Column(name = "userType")
	public Short getUserType()
	{
		return this.userType;
	}
	
	public void setUserType(Short userType)
	{
		this.userType = userType;
	}
	
	@Column(name = "vipGrade")
	public Short getVipGrade()
	{
		return this.vipGrade;
	}
	
	public void setVipGrade(Short vipGrade)
	{
		this.vipGrade = vipGrade;
	}
	
	@Column(name = "mobilePaySwitchStatus")
	public Short getMobilePaySwitchStatus()
	{
		return this.mobilePaySwitchStatus;
	}
	
	public void setMobilePaySwitchStatus(Short mobilePaySwitchStatus)
	{
		this.mobilePaySwitchStatus = mobilePaySwitchStatus;
	}
	
	@Column(name = "status")
	public Short getStatus()
	{
		return this.status;
	}
	
	public void setStatus(Short status)
	{
		this.status = status;
	}
	
	@Column(name = "safelevel")
	public Short getSafelevel()
	{
		return this.safelevel;
	}
	
	public void setSafelevel(Short safelevel)
	{
		this.safelevel = safelevel;
	}
	
	@Column(name = "payPwdFailCount")
	public Short getPayPwdFailCount()
	{
		return this.payPwdFailCount;
	}
	
	public void setPayPwdFailCount(Short payPwdFailCount)
	{
		this.payPwdFailCount = payPwdFailCount;
	}
	
	@Column(name = "lockPayTime", length = 0)
	public Date getLockPayTime()
	{
		return this.lockPayTime;
	}
	
	public void setLockPayTime(Date lockPayTime)
	{
		this.lockPayTime = lockPayTime;
	}
	
	@Column(name = "loginedTime", length = 0)
	public Date getLoginedTime()
	{
		return this.loginedTime;
	}
	
	public void setLoginedTime(Date loginedTime)
	{
		this.loginedTime = loginedTime;
	}
	
	@Column(name = "logiTempTime", length = 0)
	public Date getLogiTempTime()
	{
		return this.logiTempTime;
	}
	
	public void setLogiTempTime(Date logiTempTime)
	{
		this.logiTempTime = logiTempTime;
	}
	
	@Column(name = "loginFailCount")
	public Short getLoginFailCount()
	{
		return this.loginFailCount;
	}
	
	public void setLoginFailCount(Short loginFailCount)
	{
		this.loginFailCount = loginFailCount;
	}
	
	@Column(name = "lockLoginTime", length = 0)
	public Date getLockLoginTime()
	{
		return this.lockLoginTime;
	}
	
	public void setLockLoginTime(Date lockLoginTime)
	{
		this.lockLoginTime = lockLoginTime;
	}
	
	@Column(name = "registerTime", length = 0)
	public Date getRegisterTime()
	{
		return this.registerTime;
	}
	
	public void setRegisterTime(Date registerTime)
	{
		this.registerTime = registerTime;
	}
	
	@Column(name = "terminalsType")
	public Short getTerminalsType()
	{
		return this.terminalsType;
	}
	
	public void setTerminalsType(Short terminalsType)
	{
		this.terminalsType = terminalsType;
	}
	
	@Column(name = "upateStamp")
	public Integer getUpateStamp()
	{
		return this.upateStamp;
	}
	
	public void setUpateStamp(Integer upateStamp)
	{
		this.upateStamp = upateStamp;
	}
	
	@Column(name = "accSysMerId")
	public Integer getAccSysMerId()
	{
		return this.accSysMerId;
	}
	
	public void setAccSysMerId(Integer accSysMerId)
	{
		this.accSysMerId = accSysMerId;
	}
	
	@Column(name = "investCode")
	public Integer getInvestCode()
	{
		return investCode;
	}

	public void setInvestCode(Integer investCode)
	{
		this.investCode = investCode;
	}

	@Transient
	public BigDecimal getCash()
	{
		return cash;
	}
	
	public void setCash(BigDecimal cash)
	{
		this.cash = cash;
	}
	
	@Transient
	public BigDecimal getCongealWithdrawCash()
	{
		return congealWithdrawCash;
	}
	
	public void setCongealWithdrawCash(BigDecimal congealWithdrawCash)
	{
		this.congealWithdrawCash = congealWithdrawCash;
	}
	
	@Transient
	public BigDecimal getHkbInvestAmount()
	{
		return hkbInvestAmount;
	}
	
	public void setHkbInvestAmount(BigDecimal hkbInvestAmount)
	{
		this.hkbInvestAmount = hkbInvestAmount;
	}
	
	@Transient
	public BigDecimal getProfitAmount()
	{
		return profitAmount;
	}
	
	public void setProfitAmount(BigDecimal profitAmount)
	{
		this.profitAmount = profitAmount;
	}
	
	@Transient
	public BigDecimal getWithdrawAccumulate()
	{
		return withdrawAccumulate;
	}
	
	public void setWithdrawAccumulate(BigDecimal withdrawAccumulate)
	{
		this.withdrawAccumulate = withdrawAccumulate;
	}
	
	@Transient
	public BigDecimal getWithdrawFeeAccumulate()
	{
		return withdrawFeeAccumulate;
	}
	
	public void setWithdrawFeeAccumulate(BigDecimal withdrawFeeAccumulate)
	{
		this.withdrawFeeAccumulate = withdrawFeeAccumulate;
	}

	@Transient
	public BigDecimal getRechargeAccumulate()
	{
		return rechargeAccumulate;
	}
	
	public void setRechargeAccumulate(BigDecimal rechargeAccumulate)
	{
		this.rechargeAccumulate = rechargeAccumulate;
	}
	
	@Transient
	public String getBankCardID()
	{
		return bankCardID;
	}
	
	public void setBankCardID(String bankCardID)
	{
		this.bankCardID = bankCardID;
	}
	
	@Transient
	public String getDataName()
	{
		return dataName;
	}
	
	public void setDataName(String dataName)
	{
		this.dataName = dataName;
	}
	
	@Transient
	public Integer getBankCode()
	{
		return bankCode;
	}
	
	public void setBankCode(Integer bankCode)
	{
		this.bankCode = bankCode;
	}

	@Transient
	public String getInvestRealName()
	{
		return investRealName;
	}
	
	public void setInvestRealName(String investRealName)
	{
		this.investRealName = investRealName;
	}

	@Transient
	public BigDecimal getSingleDaypayedAmount() {
		return singleDaypayedAmount;
	}

	public void setSingleDaypayedAmount(BigDecimal singleDaypayedAmount) {
		this.singleDaypayedAmount = singleDaypayedAmount;
	}
	@Transient
	public String getStatusName() {
		return status==null?null:(status.shortValue() == UserLockStatus.ACTIVE.getValue()?UserDef.USER_LOCK_STATUS_ACTIVE:UserDef.USER_LOCK_STATUS_LOCK);
	}

	@Transient
	public Integer getAcc_cnt() {
		return acc_cnt;
	}

	public void setAcc_cnt(Integer acc_cnt) {
		this.acc_cnt = acc_cnt;
	}
	
	@Column(name = "tasteSign")
	public Integer getTasteSign() {
		return tasteSign;
	}

	public void setTasteSign(Integer tasteSign) {
		this.tasteSign = tasteSign;
	}

	@Transient
	public int[] getVip() {
		return vip;
	}

	public void setVip(int[] vip) {
		this.vip = vip;
	}
    
	@Transient
	public BigDecimal getTasteAccAmount()
	{
		return tasteAccAmount;
	}

	public void setTasteAccAmount(BigDecimal tasteAccAmount)
	{
		this.tasteAccAmount = tasteAccAmount;
	}
	
}
